import request from '@/utils/request'

// 登录
export const loginAPI = (loginForm) => {
  return request('/login', 'post', loginForm)
}

/**
 * 根据openID获取用户信息
  **/
export const getUserInfoAPI = (unionId, source = 6) => {
  return request('/login/social', 'post',
    {
      // unionld:QQ分配openID
      unionId,
      source
    })
}

/**
 * 提价用户手机号绑定
 */

export const postUserBindAPI = ({ unionId, mobile, code }) => {
  return request('/login/social/bind', 'post',
    {
      // unionld:QQ分配openID
      unionId,
      mobile,
      code
    })
}

/**
 *获取验证码
 */
export const getCodeAPI = (mobile) => {
  return request('/login/social/code', 'get', {
    mobile
  })
}
